/**
 * <copyright>
 * </copyright>
 *

 */
package br.ufpe.cin.plp.eseml.impl;

import br.ufpe.cin.plp.eseml.EsemlPackage;
import br.ufpe.cin.plp.eseml.HypothesisOperand;

import java.util.Collection;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;

import org.eclipse.emf.ecore.util.EDataTypeEList;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Hypothesis Operand</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link br.ufpe.cin.plp.eseml.impl.HypothesisOperandImpl#getDependentVariable <em>Dependent Variable</em>}</li>
 *   <li>{@link br.ufpe.cin.plp.eseml.impl.HypothesisOperandImpl#getInpendentVariables <em>Inpendent Variables</em>}</li>
 *   <li>{@link br.ufpe.cin.plp.eseml.impl.HypothesisOperandImpl#getInpendentVariablesValues <em>Inpendent Variables Values</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class HypothesisOperandImpl extends MinimalEObjectImpl.Container implements HypothesisOperand
{
  /**
   * The default value of the '{@link #getDependentVariable() <em>Dependent Variable</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getDependentVariable()
   * @generated
   * @ordered
   */
  protected static final String DEPENDENT_VARIABLE_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getDependentVariable() <em>Dependent Variable</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getDependentVariable()
   * @generated
   * @ordered
   */
  protected String dependentVariable = DEPENDENT_VARIABLE_EDEFAULT;

  /**
   * The cached value of the '{@link #getInpendentVariables() <em>Inpendent Variables</em>}' attribute list.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getInpendentVariables()
   * @generated
   * @ordered
   */
  protected EList<String> inpendentVariables;

  /**
   * The cached value of the '{@link #getInpendentVariablesValues() <em>Inpendent Variables Values</em>}' attribute list.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getInpendentVariablesValues()
   * @generated
   * @ordered
   */
  protected EList<String> inpendentVariablesValues;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected HypothesisOperandImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  protected EClass eStaticClass()
  {
    return EsemlPackage.Literals.HYPOTHESIS_OPERAND;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String getDependentVariable()
  {
    return dependentVariable;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setDependentVariable(String newDependentVariable)
  {
    String oldDependentVariable = dependentVariable;
    dependentVariable = newDependentVariable;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, EsemlPackage.HYPOTHESIS_OPERAND__DEPENDENT_VARIABLE, oldDependentVariable, dependentVariable));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EList<String> getInpendentVariables()
  {
    if (inpendentVariables == null)
    {
      inpendentVariables = new EDataTypeEList<String>(String.class, this, EsemlPackage.HYPOTHESIS_OPERAND__INPENDENT_VARIABLES);
    }
    return inpendentVariables;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EList<String> getInpendentVariablesValues()
  {
    if (inpendentVariablesValues == null)
    {
      inpendentVariablesValues = new EDataTypeEList<String>(String.class, this, EsemlPackage.HYPOTHESIS_OPERAND__INPENDENT_VARIABLES_VALUES);
    }
    return inpendentVariablesValues;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case EsemlPackage.HYPOTHESIS_OPERAND__DEPENDENT_VARIABLE:
        return getDependentVariable();
      case EsemlPackage.HYPOTHESIS_OPERAND__INPENDENT_VARIABLES:
        return getInpendentVariables();
      case EsemlPackage.HYPOTHESIS_OPERAND__INPENDENT_VARIABLES_VALUES:
        return getInpendentVariablesValues();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @SuppressWarnings("unchecked")
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case EsemlPackage.HYPOTHESIS_OPERAND__DEPENDENT_VARIABLE:
        setDependentVariable((String)newValue);
        return;
      case EsemlPackage.HYPOTHESIS_OPERAND__INPENDENT_VARIABLES:
        getInpendentVariables().clear();
        getInpendentVariables().addAll((Collection<? extends String>)newValue);
        return;
      case EsemlPackage.HYPOTHESIS_OPERAND__INPENDENT_VARIABLES_VALUES:
        getInpendentVariablesValues().clear();
        getInpendentVariablesValues().addAll((Collection<? extends String>)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case EsemlPackage.HYPOTHESIS_OPERAND__DEPENDENT_VARIABLE:
        setDependentVariable(DEPENDENT_VARIABLE_EDEFAULT);
        return;
      case EsemlPackage.HYPOTHESIS_OPERAND__INPENDENT_VARIABLES:
        getInpendentVariables().clear();
        return;
      case EsemlPackage.HYPOTHESIS_OPERAND__INPENDENT_VARIABLES_VALUES:
        getInpendentVariablesValues().clear();
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case EsemlPackage.HYPOTHESIS_OPERAND__DEPENDENT_VARIABLE:
        return DEPENDENT_VARIABLE_EDEFAULT == null ? dependentVariable != null : !DEPENDENT_VARIABLE_EDEFAULT.equals(dependentVariable);
      case EsemlPackage.HYPOTHESIS_OPERAND__INPENDENT_VARIABLES:
        return inpendentVariables != null && !inpendentVariables.isEmpty();
      case EsemlPackage.HYPOTHESIS_OPERAND__INPENDENT_VARIABLES_VALUES:
        return inpendentVariablesValues != null && !inpendentVariablesValues.isEmpty();
    }
    return super.eIsSet(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public String toString()
  {
    if (eIsProxy()) return super.toString();

    StringBuffer result = new StringBuffer(super.toString());
    result.append(" (dependentVariable: ");
    result.append(dependentVariable);
    result.append(", inpendentVariables: ");
    result.append(inpendentVariables);
    result.append(", inpendentVariablesValues: ");
    result.append(inpendentVariablesValues);
    result.append(')');
    return result.toString();
  }

} //HypothesisOperandImpl
